<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ page import="org.lsms.dao.impl.*" %>
<%@ page import="org.lsms.bean.Topic"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>Member Select Topics Page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="LSMS,ICSEE,MEMBER">
	
	<link rel="stylesheet" type="text/css" href="../css/author_layout.css">
	<link rel="stylesheet" type="text/css" href="../css/hyper_link_style.css">

	<script type="text/javascript">
	
	function check(){
		var topic1 = document.select_topic.topic1;
		var topic2 = document.select_topic.topic2;
		if(topic1.value==""){
			alert("You are request to select at least 2 topics!");
			topic1.focus();
			return false;
		}else if(topic2.value==""){
			alert("You are request to select at least 2 topics!");
			topic2.focus();
			return false;
		}else{
			return true;
		}
	}
	
	</script>

  </head>
  
  <body>
	<div id="container">
		<div id="header" class="logo_image"></div>
		<div class="nav"></div>
		<div id="author_menu" class="border">
			<table border="0" width="100%"  >
				<tr>
					<td  bgcolor="#CCCCCC"><a href="../index.jsp">imimpHome</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="select_topic.jsp">Select Topics</a></td>
				</tr>
				<tr>
				<%
					DaoImpl impl_set = new DaoImpl();
					HashMap<String,Integer> hm_set = impl_set.get_site_setting();
					int reviewer_invite = hm_set.get("reviewer_invite");
					if(reviewer_invite==1){
				 %>
					<td  bgcolor="#CCCCCC"><a href="invite_reviewer.jsp">Invite Reviewer</a></td>
				 <%
					}else{
				 %>
				 	<td  bgcolor="#CCCCCC"><a href="../error/invite_reviewer_forbidden.jsp">Invite Reviewer</a></td>	
				 <%
					}
				 %>		
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="reviewer_conf.jsp">Reviewer Confirmation</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="paper_assign.jsp">Paper Status/Paper Assign</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="member_decision.jsp">Decision</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="modify_info.jsp">Modify Information</a></td>
				</tr>
				<tr>
					<td  bgcolor="#CCCCCC"><a href="../logout">Log Out</a></td>
				</tr>
			</table>
		</div>
		
		<div id="content" class="bg_color border" style="height:265px;text-align:left;">
			<div style="margin:15px;">
			<p><b>Select Your topics</b></P>
			<form action="../select_topic" name="select_topic" method="post" onSubmit="return check()">
			1: <select name="topic1" style="width:300px;">
				<option style="width:150px" value="" selected>----Please Choose----</option>
					<%
						DaoImpl impl = new DaoImpl();
						HashMap<String,List<Topic>> map = impl.get_all_topic();
						List<Topic> list = map.get("all");
						String key5 = "";
						for(int i=0;i<list.size();i++){
							Topic topic = list.get(i);
							key5 = topic.getTopicname();
							out.write("<option value=\"");
							out.print(key5);
							out.write("\">");
							out.print(topic.getTopiccontent());
							out.write("</option>");
						}
					%>	
			</select><span class="star">*</span>
			<br>
			2: <select name="topic2" style="width:300px;">
				<option style="width:150px" value="" selected>----Please Choose----</option>
					<%
						HashMap<String,List<Topic>> map2 = impl.get_all_topic();
						List<Topic> list2 = map2.get("all");
						String key2 = "";
						for(int i=0;i<list2.size();i++){
							Topic topic = list2.get(i);
							key2 = topic.getTopicname();
							out.write("<option value=\"");
							out.print(key2);
							out.write("\">");
							out.print(topic.getTopiccontent());
							out.write("</option>");
						}
					%>		
			</select><span class="star">*</span>
			<br>
			3: <select name="topic3" style="width:300px;">
				<option style="width:150px" value="" selected>----Please Choose----</option>
					<%
						HashMap<String,List<Topic>> map3 = impl.get_all_topic();
						List<Topic> list3 = map3.get("all");
						String key3 = "";
						for(int i=0;i<list3.size();i++){
							Topic topic = list3.get(i);
							key3 = topic.getTopicname();
							out.write("<option value=\"");
							out.print(key3);
							out.write("\">");
							out.print(topic.getTopiccontent());
							out.write("</option>");
						}
					%>	
			</select>
			<br>
			4: <select name="topic4" style="width:300px;">
				<option style="width:150px" value="" selected>----Please Choose----</option>
					<%
						HashMap<String,List<Topic>> map4 = impl.get_all_topic();
						List<Topic> list4 = map4.get("all");
						String key4 = "";
						for(int i=0;i<list4.size();i++){
							Topic topic = list4.get(i);
							key4 = topic.getTopicname();
							out.write("<option value=\"");
							out.print(key4);
							out.write("\">");
							out.print(topic.getTopiccontent());
							out.write("</option>");
						}
					%>	
			</select>
			<br>
			<br>
			<input type="submit" name="submit" value="Submit">
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<span class="star">*</span><font size="3px"> is mandatory!</font> 
			</form>
			</div>
		</div>
		
		<div class="nav"></div>
			
		<div id="footer" class="footer_color border">
			<p align="center"><b>&copy;2010 LSMS-All Rights Reserved.</b></p>
			<p align="center"> <b>Powered by Shu.</b></p>
		</div>
	</div>
  </body>
</html>
